const Koa = require('koa');
const app = new Koa();
const port = 6767;          // 端口号 

const KoaCors = require('koa-cors')
const KoaBody = require('koa-body')     

app.use(KoaCors());     // 跨域
app.use(KoaBody());     // 处理post请求 和 文件上传



const userRouter = require('./router/user')
app.use( userRouter.routes() ).use( userRouter.allowedMethods() );


app.listen(port,()=>{
    console.log(`start at http://localhost:${port}/`);
})